package com.zzsong.abstract_factory;

import com.zzsong.abstract_factory.impl.Computer1;
import com.zzsong.abstract_factory.impl.Computer2;

public class TestFactory {
    public static void main(String[] args) {
        //电脑1
        ComputerFactory computer1=new Computer1();
        System.out.println("组装产品类型1：");
        computer1.createCPU().cpu();
        computer1.createMainBoard().mainboard();
        computer1.createRAM().ram();

        //电脑2
        ComputerFactory computer2=new Computer2();
        System.out.println("组装产品类型2：");
        computer2.createCPU().cpu();
        computer2.createMainBoard().mainboard();
        computer2.createRAM().ram();



    }
}
